<template>
	<view>
		<!-- 暂无数据 S -->
		<view v-if="list.length == 0">
			<view class="tp-h98 tp-w100"></view>
			<text class="tp-h98 center_combo">暂无记录</text>
			<view class="tp-h98 tp-w100"></view>
		</view>
		<!-- 暂无数据 E -->
		<view class="tp-pd30 tp-bgf tp-bdbm flex flex_column tp-fz26 tp-fc333" v-for="(item,index) in list">
			<view class="level_align flex_between">
				<view class="level_align">
					<text class="tp-fc666 tp-mr10">商家类型：</text>{{item.shopType == 1 ? '商城' : item.shopType == 2 ? '酒店' :item.shopType == 3 ? '景区' : item.shopType == 4 ?'交通' : ''}}
				</view>
					<view class="tp-fc666">{{item.applyTime}}</view>
			</view>
			<view class="level_align tp-mt10" @click="setClipboardData(item.username)">
				<text class="tp-fc666 tp-mr10">登录账号：</text>{{item.username}}
			</view>
			<!-- <view class="level_align tp-mt10" @click="setClipboardData(item.pwd)">
				<text class="tp-fc666 tp-mr10">登录密码：</text>{{item.pwd}}
			</view> -->
			<view class="level_align tp-mt10" @click="setClipboardData(item.loginUrl)">
				<text class="tp-fc666 tp-mr10 tp-wsn" >登录地址：</text> <text class="ellispsis1" style="word-break:break-all;word-wrap:break-word">{{item.loginUrl}}</text>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [],
			};
		},
		onShow() {
			this.getShopApplyInfo()
		},
		onPullDownRefresh(){
			this.getShopApplyInfo()
		},
		methods:{
			// 请求入驻信息
			getShopApplyInfo() {
				this.$http.post(this.$api.getApplyRecord).then(res => {
					uni.stopPullDownRefresh();
					if (res.code == 200) {
						this.list = res.data
					}
				})
			},
			// #ifdef MP-WEIXIN
			// 复制
			setClipboardData(content) {
				uni.setClipboardData({
					data: content,
					success: function() {
						console.log('success');
					}
				});
			},
			// #endif
			// #ifdef H5
			//h5复制文本到剪切板
			setClipboardData(content) {
				let oInput = document.createElement('input');
			      oInput.value = content;//要复制的订单编号
			      document.body.appendChild(oInput);
			      oInput.select(); // 选择对象;
			      document.execCommand("Copy"); // 执行浏览器复制命令
				  uni.showToast({
				  	title: '复制成功'
				  })
			      oInput.remove()
			},
			// #endif
		}
	}
</script>

<style lang="scss">

</style>
